1. Field of the Invention
The present invention relates to coded block pattern (CBP) encoding and decoding in a video signal encoding and decoding system and more particularly to CBP encoding/decoding apparatus and method wherein one of variable length coding (VLC)/variable length decoding (VLD) tables stored in a memory is selectively applied for encoding and decoding a coded block pattern of a macroblock according to the number of blocks having object pixels within the macroblock, which is detected using shape information.
2. Description of Related Art
Generally, video signal compressive encoding and decoding allows not only transmission of video information via low rate channels and but also reduction of memory requirement for storing the video. Therefore, compressive encoding and decoding techniques are very important to the multimedia industry requiring applications such as storage and transmission of video.
As standardization of information compressing methods have been required for compatibility of information and extension of multimedia industry, standards for video is established based upon various applications. Representative standards for video encoding and decoding are H.261 recommended by ITU-T (International Telecommunication Union-Telecommunication Standardization Sector, old CCITF) for transmitting video information for video phone and video conferencing via ISDN (Integrated Service Digital Network), H.263 recommended by ITU-T for transmitting the video information via PSTN (Public Switched Telephone Network), MPEG (Moving Picture Experts Group)-1 recommended by ISO/IEC JTC 1/SC29/WG11 (International Standardization Organization/International Electrotechnical Commission Joint Technical Committee 1/Sub Committee 29/Working Group 11) MPEG for storing video in digital storage media (DSM), and MPEG-2 for high definition digital broadcasting such as EDTV (Enhanced Digital Television) and HDTV (High definition Television).
Compressive encoding of still image signals also has been standardized and JPEG (Joint Photographic Coding Experts Group) recommended by ISO/IEC JTC1/SC29/WG1 is a representative standard.
Such conventional video signal coding methods encode a rectangular frame or a whole picture, thus called frame-based coding. This frame-based coding method encodes texture information (e.g., luminance and chrominance) of all picture elements (pels or pixels) forming the frame.
Recently, however, instead of coding and transmitting the whole frame, there are increased demands for multimedia products and service including a function of coding and transmitting or manipulating only a particular region (or object) that a user is interested in or wants for some necessities.
In response to this tendency, an object-based coding method of encoding an image in units of arbitrarily shaped region has been actively studied, as the alternative to the frame-based coding that encodes the whole frame,
FIG. 1 and FIG. 2 show examples of test prior art images used for explaining the object-based coding. FIG. 1 shows a frame including a picture of two children playing with a ball in a certain space (background). The object-based coding is appropriate for the case that only information on an object composed of children and a ball in the video information is needed for transmission. Namely, only texture information values of pixels forming the children and ball are encoded and transmitted. Here, the region of the children and ball is called an object and the other region than or excluding the object is called a background.
For compressively encoding the image shown FIG. 1 using the object-based coding, an encoder and a decoder should equally recognize which pixels of the whole frame pixels are for the children and ball and which pixels of the whole frame pixels are for the background. Such information is called shape information. The encoder should efficiently encode and transmit the shape information to the decoder to permit the decoder to recognize the shape information. The largest difference between the frame-based encoder/decoder and the object-based encoder/decoder is that the object-based encoder/decoder includes a shape information encoder/decoder.
FIG. 2 shows shape information when only the children and ball is considered as an object dmong the video information. The pixels forming the children and ball have bright values and the pixels forming the background have dark values.
In order to discriminate the pixels forming the object from the pixels forming the background as shown in FIG. 2, the pixels are represented by shape information having predetermined values according to regions they belong to. This is called a binary mask. For example, all the pixels belonging to the background have a value “0” and all the pixels belonging to the objet have a value “255”, so that each pixel has one value between “0” and “255”. For the object-based coding, the shape information for identifying and discriminating object pixels and background pixels among all the pixels forming a whole picture is required. Each of the object pixels has the texture information.
The shape information can be represented by a contour indicating a boundary between the background and the object other than the binary mask. The two types are alternative. Contour extraction is carried out to express the binary mask as contour information. Alternatively, contour filling is carried out to obtain the binary mask from the contour information. For the purpose of encoding and transmitting to the decoder the shape information with the small amount of bits, effective shape information coding method is required. This shape information coding method is not related to the present invention, so the detailed description on it will be omitted.
Representative frame-based coding methods are H.261 and H.263 recommended by ITU-T, MPEG-1 and MPEG-2 by ISO/IEC JTC1/SC29/WG11, and JPEG by ISO/IEC JTC1/SC29/WG1. Representative object-based coding methods are MPEG-4 recommended by ISO/IEC JTC1/SC29/WG11 and JPEG2000 by ISO/IEC JTC1/SC29/WG1.
A conventional video signal coding method used most widely in the world is transform coding. The transform coding converts video signals into transform coefficients (or frequency coefficients) to suppress transmission of high frequency components and to transmit signals of low frequency components. This method has an advantage of increasing a compression ratio with reduction of loss in picture quality. Discrete Fourier transform (DFT), discrete cosine transform (DCT), discrete sine transform (DST), and Walsh-Hadamard transform (WHT) have been developed for the transform coding.
The DCT of the transform methods is excellent in compactness of video signal energy into the low-frequency component. Compared with other transform methods, the DCT provides high picture quality with only the small number of low frequency coefficients and has a fast algorithm. Due to these advantages, the DCT is the most generally used transform coding and employed for the video coding standardization systems such as H.261, H.263, MPEG-1, MPEG-2, MPEG-4, and JPEG.
The conventional frame-based coding divides a frame into macroblocks each respectively having 16 pixels in length and width (hereinafter this size is expressed as 16*16) and carries out the coding in the unit of macroblock. Namely, motion estimation, motion compensation, and coding type decision is carried out with respect to the unit macroblock. The coding type determines whether to encode an input video signal or motion compensation error signal of the macroblock. A macroblock corresponding to the former is called an intra macroblock and a macroblock corresponding to the latter is called an inter macroblock.
According to conventional techniques, the DCT is performed with respect to input signals determined in accordance with the coding type and transform coefficients are transmitted. Here, the macroblock is divided into blocks of 8*8 and the DCT is performed in the unit of this block.
FIG. 3 is part of the prior art and shows the relationship between a macroblock and blocks. As shown in FIG. 3, the macroblock comprises four blocks, Y1, Y2, Y3, and Y4. Transform coefficients of blocks are quantized. The quantized coefficients marshaled on the two-dimensional blocks are re-marshaled in one dimension through scanning and then variable length coded for transmission to a receiver.
The transform coefficients are classified into a DC coefficient and an AC coefficient. The DC coefficient represents an average value of an input blocl signal. The DC coefficient has different meanings according to the coding type of a corresponding input macroblock, such as the inter macroblock or intra macroblock. For the intra macroblock, the motion compensation error is coded, so that the DC coefficient has a peripheral value in many cases. For the inter macroblock, the input video signal is coded, so that the DC coefficient has the average value of the input video signal and is used as very important information. For these reasons, many coding methods discriminate DC information from the AC information and transmit the information in detail. On the other hand, the DC coefficient may be not discriminated from the AC coefficient during the coding based upon the reason that the DC coefficient does not have large value in the intra coding.
The variable length coding (VLC) is a method for transmitting the AC coefficient. Once transform coefficients are marshaled in one dimension after passing through the scanning, a none-zero AC coefficient is two-dimensional VL-coded through combination coding of a distance to a previous none-zero AC coefficient and its own magnitude. For the last none-zero coefficient in a corresponding block, an end of block (EOB) signal is transmitted. Alternatively, three-dimensional VLC is employed for the combination of three pieces of information of a distance to another none-zero AC coefficient, a magnitude of a pertinent coefficient itself, and LAST information indicating whether the pertinent coefficient itself is the last none-zero one or not.
If all the quantized coefficients—AC and DC coefficients, or AC coefficients if the DC coefficient is separately encoded—have a value “0”, there is no data transmitted. At this time, the encoder transmits information indicating whether or not each block has data transmitted to the decoder. This kind of information is transmitted once per macroblock by combining information on four blocks of the macroblock. The combined information is called a coded block pattern. Each macroblock comprises four blocks and each block is subjected to one of two cases of having and not having data transmitted, so the coded block pattern has 16 possible cases.
FIG. 4 is a prior art VLC table for coded block patterns used in the frame-based coding.
The second column of FIG. 4 shows 16 cases of the coded block pattern of an intra macroblock. Starting from the most left one, four digits made of “0” and “1”respectively indicate existence/non-existence of data with respect to the blocks, Y1, Y2, Y3, and Y4 of FIG. 3. Here, “0” indicates nonexistence of data coded and “1” indicates existence of data coded. For example, “0101” means that the blocks Y1 and Y3 have data transmitted and the blocks Y2 and Y4 do not have data transmitted. The third column of FIG. 4 shows cases of an inter macroblock.
Although 4-bit fixed length coding (FLC) can be applied to each coded block pattern since the coded block pattern has 16 cases, but the VLC is applied to reduce the amount of bits generated. In other words, length of a code is differently assigned according to how open a case happens. For example, the more the case happens, the less the number of bits of a code is assigned and the less the case happens, the more the number of bits of a code is assigned. The fifth column of FIG. 4 shows codes used in H.263 and the fourth column shows the number of bits of each code.
The frequency in occurrence of a coded block pattern can be different according to a coding method. In case of H.263, the intra macroblock and the inter macroblock each have a different frequency in occurrence of the coded block pattern, so VLC tables for coded block patterns are differently set for the intra macroblock and inter macroblock. A particular thing is that the frequency in occurrence of coded block patterns of the intra macroblock and inter macroblock are similar to each other when the coded block patterns are in relation of 2's complement. According to the table shown in FIG. 4, the coded block pattern “1111” occurs most frequently in ease of the intra macroblock and the coded block pattern “0000” occurs most frequently in case of the inter macroblock. In case of the inter macroblock, the motion compensation error is coded, so it often happens that there is no data transmitted when motion estimation is accurate or a quantization interval is large. In case of the intra macroblock, the input video signal is coded, so most cases have data transmitted when video signals are not uniform. The coded block pattern “0110” of the inira maeroblock and the coded block pattern “1001” of the inter macroblock have least frequency in occurrence.
Although different coded block patterns are used according to the coding type, the same table is used, so the same volume of memory is used regardless of coding type.
The object-based coding also performs the coding such as DCT in the unit of block and determines the coded block pattern in the unit of macroblock. However, if the VLC table for coded block patterns used in the frame-based coding is directly applied to the object-based coding, decrease of coding efficiency is resulted in.
FIG. 5 is part of the prior art and shows an example of an input signal in the object-based coding. MB1, MB2, MB3, and MB4 respectively indicate top left, top right, bottom left, and bottom right macroblocks and each macroblock comprises Y1, Y2, Y3, and Y4 blocks. An oval-shaped, hatched part indicates a group of pixels belonging to an object (object pixels). Three blocks Y2, Y3, and Y4 of MB1 respectively include at least one object pixel. The block Y1 of MB1 has no data transmitted. Accordingly, in case that MB1 is the intra macroblock, cases corresponding to indexes 8–15 shown in the first column of FIG. 4 do not occur. At this time, the VLC table of FIG. 4 can be used, but this is inefficient. M133 has only the block Y2 as a block including the object pixel. In case that MB3 is the intra macroblock, the blocks Y1, Y3, and Y4 do not have data transmitted, and 14 cases other than cases corresponding to indexes 0 and 4 of FIG. 4 do not occur. At this time, the table of FIG. 4 can also be used, but this is inefficient.
As illustrated, the conventional coded block pattern encoding uses one VLC table for coded block patterns that is used in the frame-based coding even though macroblocks have different numbers of blocks where an object is present, thereby reducing coding efficiency.